<?php

namespace addons\shopro\controller\data;

use addons\shopro\controller\Common;
use app\admin\model\shopro\data\Richtext as RichtextModel;


class Richtext extends Common
{

    protected $noNeedLogin = ['index'];
    protected $noNeedRight = ['*'];

    public function index()
    {
        $id = $this->request->param('id');

        $data = RichtextModel::where('id', $id)->find();
        if (!$data) {
            $this->error(__('No Results were found'));
        }
		
		//上班下班时间
		$xbsj=config('site.workoff_time');
		$sbsj=config('site.workon_time');
		$nowdate=date('Y-m-d');
		$tomdate=date('Y-m-d',time()+86400);
		$xbtime=$nowdate.' '.$xbsj;
		$sbtime=$tomdate.' '.$sbsj;
		$sbtimejt=$nowdate.' '.$sbsj;
		$xdsj=date('H:i:s',$data['createtime']);
		$xdtime=date('Y-m-d H:i:s');
		$isxb=0;
		if($xdtime>$xbtime || $xdtime<$sbtimejt){
			$isxb=1;
		}
		$data['isxb']=$isxb;
		$data['xbsj']=$xbsj;
		$data['sbsj']=$sbsj;
		// $data['xbstr']='下班时间为每天'.$xbsj.'至第二天'.$sbsj.'，上班后第一时间送达';
		$data['xbstr']='上班时间为 '.$sbsj.' 当前已下班，您的订单将于上班后一小时内送达';

        $this->success('获取成功', $data);
    }
}
